<?php

/*
 * It is used to register the email subscription 
 * Getting data from ajax
 * 
 */
$pathinfo = pathinfo(__FILE__);
preg_match('/.+(?=wp-content)/', $pathinfo['dirname'], $match);
$pathNeeded = preg_replace('/\ /', '/', $match[0]);
require_once($pathNeeded . 'wp-load.php'); //refer to wp-load to use instruction

global $wpdb;
if (isset($_POST['email']) && $_POST['email']) {   
	$wpdb->query('INSERT INTO travel_eemail_newsletter_sub(`eemail_name_sub`, `eemail_email_sub`, `eemail_status_sub`,`eemail_date_sub`) 
	VALUES("NO NAME","' . $_POST['email'] . '","YES", "' . date('Y-m-d', time()) . '")');
}
